﻿namespace CSharpPro._1013;

public class demo2
{
    public static void Test2()
    {
        int sum = 0;
        for (int i = 1; i <= 100; i++)
        {
            if (!IsMultipleOfSeven(i) &&!ContainsSeven(i))
            {
                Console.Write(i + " ");
                sum += i;
            }
        }
        Console.WriteLine("\n这些数字的和为: " + sum);
    }

    static bool IsMultipleOfSeven(int num)
    {
        return num % 7 == 0;
    }

    static bool ContainsSeven(int num)
    {
        string numStr = num.ToString();
        return numStr.Contains("7");
    }
}